package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * <p>
 * 商品表 服务实现类
 * </p>
 *
 * @author 胡泽鑫
 * @since 2023-06-08
 */
@Service
public class IGoodsService implements IGoodsService {

    @Override
    public GoodsBO get(Map param) {
    return this.daoRouter.queryForObject("Goods.loadGoods",param);
    }

    @Override
    public List<GoodsBO> list(Map param) {
        return this.daoRouter.query("Goods.loadGoods",param);
    }

    @Override
    public List<GoodsBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("Goods.loadGoodsForPage",pagination);
    }

    @Override
    public void post(GoodsBO param) {
        this.daoRouter.insert("AGoods.insertGoods",param);
    }

    @Override
    public void postList(List<GoodsBO> param) {
        this.daoRouter.insert("AGoods.insertGoodsList",param);
    }

    @Override
    public void update(GoodsBO param) {
        this.daoRouter.update("AGoods.updateGoods",param);
    }

    @Override
    public void del(GoodsBO param) {
        this.daoRouter.update("AGoods.delGoods",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
